using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using CristiPotlog.Controls;
using ICP_MS.Plugin.Tune.Properties;
using ZedGraph;

namespace ICP_MS.Plugin.Tune;

public class FormHalfAutoTune : Form
{
	private HalfAutoTuneExperiment experiment = null;

	private Thread threadUptake = null;

	private Thread threadTune = null;

	private bool pauseUptake = false;

	private Color[] colors = new Color[12]
	{
		Color.Blue,
		Color.Red,
		Color.Coral,
		Color.Green,
		Color.Gold,
		Color.Purple,
		Color.Magenta,
		Color.DarkSlateBlue,
		Color.Lime,
		Color.Black,
		Color.Brown,
		Color.Coral
	};

	private IContainer components = null;

	private Wizard wizard1;

	private WizardPage wizardTuneIsotopes;

	private WizardPage wizardWelcome;

	private GroupBox groupBox2;

	private Button btnDeleteRatios;

	private Button btnAddRatios;

	private DataGridView dgvRatios;

	private DataGridViewTextBoxColumn dgvNumerator;

	private DataGridViewTextBoxColumn dgvDenominator;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;

	private GroupBox groupBox1;

	private Button btnDeleteIsotope;

	private Button btnAddIsotope;

	private DataGridView dgvIsotopes;

	private DataGridViewTextBoxColumn colSymbol;

	private DataGridViewTextBoxColumn colMass;

	private DataGridViewTextBoxColumn colDwell;

	private WizardPage wizardDevices;

	private DataGridView dgvDevices;

	private Button btnLoadCurrentParam;

	private WizardPage wizardSample;

	private WizardPage wizardUpdate;

	private System.Windows.Forms.Label label2;

	private System.Windows.Forms.Label label1;

	private Button btnContinue;

	private Button btnPause;

	private System.Windows.Forms.Label lblUptake;

	private ProgressBar barUptake;

	private System.Windows.Forms.Label label3;

	private WizardPage wizardTune;

	private DataGridViewCheckBoxColumn colUse;

	private DataGridViewCheckBoxColumn colUseDefault;

	private DataGridViewTextBoxColumn colConditions;

	private DataGridViewTextBoxColumn colMinValue;

	private DataGridViewTextBoxColumn colDefaultValue;

	private DataGridViewTextBoxColumn colMaxValue;

	private DataGridViewTextBoxColumn colError1;

	private DataGridViewTextBoxColumn colError2;

	private ListBox listBox1;

	private ZedGraphControl zedGraph;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;

	private WizardPage wizardFinish;

	private WizardPage wizardHistory;

	private GroupBox gbHistoryDescript;

	private System.Windows.Forms.Label lblHistoryDescript;

	private GroupBox gbHistoryDatas;

	private TreeView treeViewHistory;

	private WizardPage wizardEdit;

	private System.Windows.Forms.Label lblOption2;

	private System.Windows.Forms.Label lblOption1;

	private RadioButton rdbtnCreate;

	private RadioButton rdbtnEdit;

	private WizardPage wizardDescription;

	private TextBox txtCfgSolution;

	private System.Windows.Forms.Label label15;

	private TextBox txtCfgDescription;

	private System.Windows.Forms.Label label14;

	private TextBox txtCfgName;

	private System.Windows.Forms.Label label13;

	private GroupBox gbShow;

	private FlowLayoutPanel flowLayoutPanel1;

	private Button button1;

	private Button btnSet;

	private TextBox textBox1;

	private System.Windows.Forms.Label label4;

	private Button btnLog;

	public FormHalfAutoTune()
	{
		InitializeComponent();
	}

	private void wizardWelcome_Click(object sender, EventArgs e)
	{
	}

	private void btnAddIsotope_Click(object sender, EventArgs e)
	{
		FormMassSelect form = new FormMassSelect(DataBase.Instance);
		if (form.ShowDialog() == DialogResult.OK)
		{
			AnalyteIsotope isotope = form.SelectedIsotope;
			experiment.Isotopes.Add(new HalfAutoTuneExperiment.HalfTuneIsotope
			{
				Symbol = isotope.symbol,
				Mass = isotope.mass,
				Dwell = 10
			});
			ShowIsotopes();
		}
	}

	private void btnDeleteIsotope_Click(object sender, EventArgs e)
	{
		List<string> ids = new List<string>();
		List<double> atoms = new List<double>();
		foreach (DataGridViewRow row in dgvIsotopes.SelectedRows)
		{
			ids.Add(row.Cells[0].Value.ToString());
			atoms.Add(Convert.ToDouble(row.Cells[1].Value));
		}
		int i;
		for (i = 0; i < ids.Count; i++)
		{
			experiment.Isotopes.Remove(experiment.Isotopes.Find((HalfAutoTuneExperiment.HalfTuneIsotope r) => r.Symbol == ids[i] && r.Mass == atoms[i]));
			List<HalfAutoTuneExperiment.HalfTuneRatio> ratios = experiment.Ratios.FindAll((HalfAutoTuneExperiment.HalfTuneRatio r) => (r.Denominator.Symbol == ids[i] && r.Denominator.Mass == atoms[i]) || (r.Numerator.Symbol == ids[i] && r.Numerator.Mass == atoms[i]));
			foreach (HalfAutoTuneExperiment.HalfTuneRatio ratio in ratios)
			{
				experiment.Ratios.Remove(ratio);
			}
		}
		ShowIsotopes();
		ShowRatios();
	}

	private void ShowIsotopes()
	{
		dgvIsotopes.AutoGenerateColumns = false;
		if (dgvIsotopes.DataSource == null)
		{
			dgvIsotopes.DataSource = experiment.Isotopes;
			return;
		}
		BindingContext[dgvIsotopes.DataSource].SuspendBinding();
		dgvIsotopes.DataSource = null;
		dgvIsotopes.DataSource = experiment.Isotopes;
		BindingContext[dgvIsotopes.DataSource].ResumeBinding();
	}

	private void btnAddRatios_Click(object sender, EventArgs e)
	{
		IEnumerable<string> symbols = experiment.Isotopes.Select((HalfAutoTuneExperiment.HalfTuneIsotope isotope) => isotope.Symbol);
		if (symbols == null || symbols.Count() < 2)
		{
			return;
		}
		FormAutoTuneNewRatio form = new FormAutoTuneNewRatio(symbols.ToArray());
		if (form.ShowDialog() == DialogResult.OK)
		{
			string numerator = form.Numerator;
			string denominator = form.Denominator;
			experiment.Ratios.Add(new HalfAutoTuneExperiment.HalfTuneRatio
			{
				Numerator = experiment.Isotopes.Where((HalfAutoTuneExperiment.HalfTuneIsotope isotope) => isotope.Symbol == numerator).First(),
				Denominator = experiment.Isotopes.Where((HalfAutoTuneExperiment.HalfTuneIsotope isotope) => isotope.Symbol == denominator).First(),
				Dwell = 10
			});
			ShowRatios();
		}
	}

	private void ShowRatios()
	{
		dgvRatios.AutoGenerateColumns = false;
		if (dgvRatios.DataSource == null)
		{
			dgvRatios.DataSource = experiment.Ratios;
			return;
		}
		BindingContext[dgvRatios.DataSource].SuspendBinding();
		dgvRatios.DataSource = null;
		dgvRatios.DataSource = experiment.Ratios;
		BindingContext[dgvRatios.DataSource].ResumeBinding();
	}

	private void btnDeleteRatios_Click(object sender, EventArgs e)
	{
		List<HalfAutoTuneExperiment.HalfTuneIsotope> ids1 = new List<HalfAutoTuneExperiment.HalfTuneIsotope>();
		List<HalfAutoTuneExperiment.HalfTuneIsotope> ids2 = new List<HalfAutoTuneExperiment.HalfTuneIsotope>();
		foreach (DataGridViewRow row in dgvRatios.SelectedRows)
		{
			ids1.Add((HalfAutoTuneExperiment.HalfTuneIsotope)row.Cells[0].Value);
			ids2.Add((HalfAutoTuneExperiment.HalfTuneIsotope)row.Cells[1].Value);
		}
		int i;
		for (i = 0; i < ids1.Count; i++)
		{
			experiment.Ratios.Remove(experiment.Ratios.Find((HalfAutoTuneExperiment.HalfTuneRatio r) => r.Numerator.Symbol == ids1[i].Symbol && r.Denominator.Symbol == ids2[i].Symbol));
		}
		ShowRatios();
	}

	private void ShowDevices()
	{
		experiment.InitTuneDevices();
		dgvDevices.AutoGenerateColumns = false;
		if (dgvDevices.DataSource == null)
		{
			dgvDevices.DataSource = experiment.Devices;
			return;
		}
		BindingContext[dgvDevices.DataSource].SuspendBinding();
		dgvDevices.DataSource = null;
		dgvDevices.DataSource = experiment.Devices;
		BindingContext[dgvDevices.DataSource].ResumeBinding();
	}

	private void btnPause_Click(object sender, EventArgs e)
	{
		pauseUptake = true;
		btnContinue.Enabled = true;
		btnPause.Enabled = false;
	}

	private void ShowUptake()
	{
		pauseUptake = false;
		btnPause.Enabled = true;
		btnContinue.Enabled = false;
		int tickCount = 40;
		threadUptake = new Thread((ThreadStart)delegate
		{
			while (tickCount > 0)
			{
				if (!pauseUptake)
				{
					tickCount--;
				}
				Invoke((MethodInvoker)delegate
				{
					barUptake.Value = tickCount;
					lblUptake.Text = $"{tickCount} s";
				});
				Thread.Sleep(1000);
			}
			wizard1.Next();
		});
		threadUptake.Start();
	}

	private void btnContinue_Click(object sender, EventArgs e)
	{
		pauseUptake = false;
		btnPause.Enabled = true;
		btnContinue.Enabled = false;
	}

	private void wizard1_BeforeSwitchPages(object sender, Wizard.BeforeSwitchPagesEventArgs e)
	{
		WizardPage oldPage = wizard1.Pages[e.OldIndex];
		switch (e.OldIndex)
		{
		case 0:
			break;
		case 1:
			if (!rdbtnCreate.Checked && !rdbtnEdit.Checked)
			{
				MessageBox.Show(Lang.Txt("Tune.Text1"));
				e.Cancel = true;
			}
			else if (rdbtnCreate.Checked)
			{
				e.NewIndex++;
				experiment = new HalfAutoTuneExperiment();
			}
			break;
		case 2:
			if (experiment == null)
			{
				MessageBox.Show(Lang.Txt("Tune.Text2"));
				e.Cancel = true;
			}
			break;
		case 3:
			if (e.NewIndex > e.OldIndex && experiment.Isotopes.Count == 0)
			{
				MessageBox.Show(Lang.Txt("Tune.Text3"));
				e.Cancel = true;
			}
			break;
		case 4:
			if (e.NewIndex > e.OldIndex && experiment.Devices.FindAll((HalfAutoTuneExperiment.HalfDeviceCondition d) => d.Selected).Count != 1)
			{
				MessageBox.Show(Lang.Txt("FormHalfAutoTune.TipsText1"));
				e.Cancel = true;
			}
			break;
		case 5:
			SaveConfig();
			experiment.SaveConfig();
			break;
		case 6:
			break;
		case 7:
			if (threadUptake != null && threadUptake.IsAlive)
			{
				threadUptake.Abort();
				threadUptake = null;
			}
			break;
		case 8:
			experiment.EventTuneFinish += experiment_EventTuneFinish;
			experiment.EventTuneMsg += experiment_EventTuneMsg;
			break;
		case 9:
			break;
		case 10:
			break;
		}
	}

	private void experiment_EventTuneFinish(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			wizard1.NextEnabled = true;
			wizard1.BackEnabled = true;
		});
	}

	private void experiment_EventTuneMsg(object sender, HalfMsgEventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			listBox1.Items.Add(e.Message);
			listBox1.SelectedIndex = listBox1.Items.Count - 1;
		});
	}

	private void ShowConfig()
	{
		txtCfgName.Text = experiment.Name;
		txtCfgDescription.Text = experiment.Description;
		txtCfgSolution.Text = experiment.Solution;
	}

	private void SaveConfig()
	{
		experiment.Name = txtCfgName.Text;
		experiment.Description = txtCfgDescription.Text;
		experiment.Solution = txtCfgSolution.Text;
	}

	private void experiment_EventTuneResult(object sender, ResultEventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			int num = 0;
			for (num = 0; num < e.Mass.Count(); num++)
			{
				zedGraph.GraphPane.CurveList[num].AddPoint(e.DeviceValue, e.Intensity[num]);
				listBox1.Items.Add(string.Format("{0}:{1}", zedGraph.GraphPane.CurveList[num].Tag.ToString(), e.Intensity[num].ToString("F0")));
			}
			if (experiment.Ratios != null && experiment.Ratios.Count > 0)
			{
				foreach (HalfAutoTuneExperiment.HalfTuneRatio ratio in experiment.Ratios)
				{
					double num2 = e.Intensity.Where((double data, int index) => e.Mass[index] >= ratio.Numerator.Mass - 0.1 && e.Mass[index] <= ratio.Numerator.Mass + 0.1).Average();
					double num3 = e.Intensity.Where((double data, int index) => e.Mass[index] >= ratio.Denominator.Mass - 0.1 && e.Mass[index] <= ratio.Denominator.Mass + 0.1).Average();
					double num4 = num2 / num3;
					zedGraph.GraphPane.CurveList[num++].AddPoint(e.DeviceValue, num4);
					listBox1.Items.Add(string.Format("{0}:{1}", zedGraph.GraphPane.CurveList[num - 1].Tag.ToString(), num4.ToString("F4")));
				}
			}
			zedGraph.GraphPane.AxisChange();
			zedGraph.Refresh();
		});
	}

	private void ShowHistoryFiles()
	{
		treeViewHistory.Nodes[0].Nodes.Clear();
		wizard1.BackEnabled = true;
		string[] files = HalfAutoTuneExperiment.LoadAllConfigs();
		string[] array = files;
		foreach (string file in array)
		{
			string name = Path.GetFileNameWithoutExtension(file);
			treeViewHistory.Nodes[0].Nodes.Add(name, name);
		}
		if (experiment != null)
		{
			treeViewHistory.SelectedNode = treeViewHistory.Nodes[0].Nodes[experiment.Name];
			lblHistoryDescript.Text = experiment.Description;
		}
	}

	private void wizard1_AfterSwitchPages(object sender, Wizard.AfterSwitchPagesEventArgs e)
	{
		WizardPage newPage = wizard1.Pages[e.NewIndex];
		switch (e.NewIndex)
		{
		case 0:
			break;
		case 2:
			ShowHistoryFiles();
			break;
		case 3:
			ShowIsotopesRatios();
			wizard1.BackEnabled = true;
			break;
		case 4:
			ShowDevices();
			wizard1.BackEnabled = true;
			break;
		case 5:
			ShowConfig();
			break;
		case 6:
			label3.Text = experiment.Solution;
			break;
		case 7:
			ShowUptake();
			break;
		case 8:
			experiment.EventTuneFinish += experiment_EventTuneFinish;
			experiment.EventTuneMsg += experiment_EventTuneMsg;
			experiment.EventTuneResult += experiment_EventTuneResult;
			InitZedGraph();
			ShowTune();
			wizard1.NextEnabled = false;
			wizard1.BackEnabled = false;
			break;
		case 9:
			ShowResults();
			wizard1.NextEnabled = false;
			wizard1.BackEnabled = false;
			break;
		case 1:
			break;
		}
	}

	private void ShowTune()
	{
		experiment.StartTune();
	}

	private void ShowResults()
	{
	}

	private void ShowIsotopesRatios()
	{
		ShowIsotopes();
		ShowRatios();
	}

	private void wizard1_Load(object sender, EventArgs e)
	{
		wizard1.NextText = Lang.Txt("FormHalfAutoTune.NextStep");
		wizard1.BackText = Lang.Txt("FormHalfAutoTune.LastStep");
		wizard1.CancelText = Lang.Txt("Tune.Cancel");
		wizard1.OkText = Lang.Txt("FormHalfAutoTune.OK");
	}

	private void dgvRatios_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
		if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
		{
			int columnIndex = e.ColumnIndex;
			int num = columnIndex;
			if ((uint)num <= 1u)
			{
				HalfAutoTuneExperiment.HalfTuneIsotope isotope = e.Value as HalfAutoTuneExperiment.HalfTuneIsotope;
				e.Value = isotope.Symbol;
			}
		}
	}

	private void dgvDevices_CellValueChanged(object sender, DataGridViewCellEventArgs e)
	{
	}

	private void FormHalfAutoTune_Load(object sender, EventArgs e)
	{
		zedGraph.GraphPane.Title.Text = "";
		zedGraph.GraphPane.Y2Axis.IsVisible = true;
		ApplyResources();
	}

	private void ApplyResources()
	{
		Text = Lang.Txt("FormHalfAutoTune.Text1");
		wizardWelcome.Title = Lang.Txt("FormHalfAutoTune.Text1");
		wizardWelcome.Description = Lang.Txt("FormHalfAutoTune.Text2");
		wizardEdit.Title = Lang.Txt("FormHalfAutoTune.Text3");
		wizardEdit.Description = Lang.Txt("FormHalfAutoTune.Text4");
		rdbtnEdit.Text = Lang.Txt("FormHalfAutoTune.Text5");
		lblOption1.Text = Lang.Txt("FormHalfAutoTune.Text6");
		rdbtnCreate.Text = Lang.Txt("FormHalfAutoTune.Text7");
		lblOption2.Text = Lang.Txt("FormHalfAutoTune.Text8");
		wizardTuneIsotopes.Title = Lang.Txt("Tune.Mesg11");
		wizardTuneIsotopes.Description = Lang.Txt("Tune.Mesg12");
		groupBox1.Text = Lang.Txt("Tune.TuningElements");
		groupBox2.Text = Lang.Txt("Tune.Ratio");
		colSymbol.HeaderText = Lang.Txt("Tune.Element");
		colMass.HeaderText = Lang.Txt("Tune.Mass");
		colDwell.HeaderText = Lang.Txt("Tune.DwellTime.Text");
		dgvNumerator.HeaderText = Lang.Txt("ADDTune.TuneDebug.Molecular");
		dgvDenominator.HeaderText = Lang.Txt("ADDTune.TuneDebug.Denominator");
		dataGridViewTextBoxColumn3.HeaderText = Lang.Txt("Tune.DwellTime.Text");
		btnAddIsotope.Text = Lang.Txt("FormScan.Add.Text");
		btnDeleteIsotope.Text = Lang.Txt("FormScan.Delete.Text");
		btnAddRatios.Text = Lang.Txt("FormScan.Add.Text");
		btnDeleteRatios.Text = Lang.Txt("FormScan.Delete.Text");
		wizardDevices.Title = Lang.Txt("Tune.Mesg13");
		wizardDevices.Description = Lang.Txt("Tune.Mesg14");
		colUse.HeaderText = Lang.Txt("Tune.Use");
		colUseDefault.HeaderText = Lang.Txt("Tune.Default");
		colConditions.HeaderText = Lang.Txt("Tune.Hardware");
		colMinValue.HeaderText = Lang.Txt("Tune.MinValue");
		colDefaultValue.HeaderText = Lang.Txt("Tune.DefaultValue");
		colMaxValue.HeaderText = Lang.Txt("Tune.MaxValue");
		colError2.HeaderText = Lang.Txt("Tune.Step");
		colError1.HeaderText = Lang.Txt("Tune.SettingError");
		btnLoadCurrentParam.Text = Lang.Txt("Tune.LoadParam");
		wizardDescription.Title = Lang.Txt("Tune.Mesg19");
		wizardDescription.Description = Lang.Txt("Tune.Mesg20");
		label13.Text = Lang.Txt("Tune.ConfigName");
		label14.Text = Lang.Txt("Tune.ConfigInstructions");
		label15.Text = Lang.Txt("Tune.TuningSolutions");
		wizardSample.Title = Lang.Txt("Tune.Text22");
		wizardSample.Description = Lang.Txt("Tune.Text23");
		label1.Text = Lang.Txt("Tune.Text24");
		label2.Text = Lang.Txt("Tune.Text25");
		wizardUpdate.Title = Lang.Txt("Tune.Text26");
		label3.Text = Lang.Txt("Tune.Text27");
		btnPause.Text = Lang.Txt("Tune.Pause");
		btnContinue.Text = Lang.Txt("Tune.Continue");
		wizardTune.Title = Lang.Txt("FormHalfAutoTune.Text9");
		wizardTune.Description = Lang.Txt("FormHalfAutoTune.Text10");
		label4.Text = Lang.Txt("FormHalfAutoTune.Text11");
		btnSet.Text = Lang.Txt("FormHalfAutoTune.Text12");
		gbShow.Text = Lang.Txt("FormHalfAutoTune.Text13");
		wizardHistory.Title = Lang.Txt("Tune.Mesg7");
		wizardHistory.Description = Lang.Txt("Tune.Mesg8");
		gbHistoryDatas.Text = Lang.Txt("Tune.HistoryConfiguration");
		treeViewHistory.Nodes[0].Text = Lang.Txt("Tune.HistoryData");
		gbHistoryDescript.Text = Lang.Txt("Tune.ConfigurationInstructions");
		button1.Text = Lang.Txt("AddiMass.Text30");
		wizardFinish.Title = Lang.Txt("Tune.Mesg21");
		wizardFinish.Description = Lang.Txt("Tune.Mesg22");
		btnLog.Text = Lang.Txt("FormHalfAutoTune.Log");
	}

	public void InitZedGraph()
	{
		zedGraph.GraphPane.CurveList.Clear();
		zedGraph.GraphPane.XAxis.Scale.Min = experiment.Devices.Find((HalfAutoTuneExperiment.HalfDeviceCondition r) => r.Selected).MinValue;
		zedGraph.GraphPane.XAxis.Scale.Max = experiment.Devices.Find((HalfAutoTuneExperiment.HalfDeviceCondition r) => r.Selected).MaxValue;
		int colorindex = 0;
		experiment.Isotopes.Sort((HalfAutoTuneExperiment.HalfTuneIsotope i1, HalfAutoTuneExperiment.HalfTuneIsotope i2) => i1.Mass.CompareTo(i2.Mass));
		foreach (HalfAutoTuneExperiment.HalfTuneIsotope isotope in experiment.Isotopes)
		{
			LineItem line2 = zedGraph.GraphPane.AddCurve(isotope.Symbol, new PointPairList(), colors[colorindex], SymbolType.None);
			line2.Tag = isotope.Symbol;
			line2.Line.Width = 2f;
			CheckBox checkBox2 = new CheckBox();
			checkBox2.Text = isotope.Symbol;
			checkBox2.Checked = true;
			checkBox2.AutoSize = true;
			checkBox2.CheckedChanged += CheckBox_CheckedChanged;
			checkBox2.ForeColor = colors[colorindex];
			flowLayoutPanel1.Controls.Add(checkBox2);
			colorindex++;
		}
		foreach (HalfAutoTuneExperiment.HalfTuneRatio ratio in experiment.Ratios)
		{
			LineItem line = zedGraph.GraphPane.AddCurve($"{ratio.Numerator.Symbol}/{ratio.Denominator.Symbol}", new PointPairList(), colors[colorindex], SymbolType.None);
			line.IsY2Axis = true;
			line.Line.Width = 2f;
			line.Tag = $"{ratio.Numerator.Symbol}/{ratio.Denominator.Symbol}";
			CheckBox checkBox = new CheckBox();
			checkBox.Text = $"{ratio.Numerator.Symbol}/{ratio.Denominator.Symbol}";
			checkBox.Checked = true;
			checkBox.AutoSize = true;
			checkBox.CheckedChanged += CheckBox_CheckedChanged;
			checkBox.ForeColor = colors[colorindex];
			flowLayoutPanel1.Controls.Add(checkBox);
			colorindex++;
		}
		zedGraph.GraphPane.Legend.IsVisible = true;
	}

	private void CheckBox_CheckedChanged(object sender, EventArgs e)
	{
		string symbol = (sender as CheckBox).Text;
		CurveItem line = zedGraph.GraphPane.CurveList.Find((CurveItem r) => r.Tag.ToString() == symbol);
		if (line != null)
		{
			line.IsVisible = (sender as CheckBox).Checked;
		}
		zedGraph.Refresh();
	}

	private void btnLoadCurrentParam_Click(object sender, EventArgs e)
	{
		foreach (HalfAutoTuneExperiment.HalfDeviceCondition device in experiment.Devices)
		{
			switch (device.Id)
			{
			case 0:
				device.DefaultValue = PlatManager.plat.X;
				break;
			case 1:
				device.DefaultValue = PlatManager.plat.Z;
				break;
			case 2:
				device.DefaultValue = PlatManager.plat.Y;
				break;
			case 3:
				device.DefaultValue = LensManager.x2lens.Ex;
				break;
			case 4:
				device.DefaultValue = LensManager.x2lens.L1;
				break;
			case 5:
				device.DefaultValue = LensManager.x2lens.L2;
				break;
			case 6:
				device.DefaultValue = LensManager.x2lens.F;
				break;
			case 7:
				device.DefaultValue = LensManager.x2lens.D1;
				break;
			case 8:
				device.DefaultValue = LensManager.x2lens.D2;
				break;
			case 9:
				device.DefaultValue = LensManager.x2lens.QE;
				break;
			case 10:
				device.DefaultValue = LensManager.x2lens.Pole;
				break;
			case 11:
				device.DefaultValue = LensManager.x2lens.L3;
				break;
			case 12:
				device.DefaultValue = LensManager.x2lens.DA;
				break;
			case 13:
				device.DefaultValue = PlasmaManager.plasma.Nebuliser;
				break;
			case 14:
				device.DefaultValue = PlasmaManager.plasma.Cool;
				break;
			case 15:
				device.DefaultValue = PlasmaManager.plasma.Auxiliary;
				break;
			case 16:
				device.DefaultValue = PlasmaManager.plasma.Collision;
				break;
			}
		}
		dgvDevices.Refresh();
	}

	private void wizard1_Cancel(object sender, CancelEventArgs e)
	{
		if (MessageBox.Show(Lang.Txt("FormHalfAutoTune.TipsText2"), Lang.Txt("Tune.Text16"), MessageBoxButtons.YesNo) == DialogResult.No)
		{
			e.Cancel = true;
		}
		else if (threadUptake != null && threadUptake.IsAlive)
		{
			threadUptake.Abort();
			threadUptake = null;
		}
		else if (experiment != null && experiment.isTuning)
		{
			experiment.StopTune();
		}
	}

	private void treeViewHistory_AfterSelect(object sender, TreeViewEventArgs e)
	{
		if (e.Node.Nodes.Count != 0)
		{
			treeViewHistory.SelectedNode = null;
			return;
		}
		string name = e.Node.Text;
		if (experiment != null && !(experiment.Name != name))
		{
			return;
		}
		try
		{
			HalfAutoTuneExperiment exp = HalfAutoTuneExperiment.LoadConfig(name);
			experiment = exp;
			lblHistoryDescript.Text = experiment.Description;
		}
		catch (Exception)
		{
			experiment = null;
			lblHistoryDescript.Text = "";
			treeViewHistory.Nodes[0].Nodes.Remove(e.Node);
			treeViewHistory.SelectedNode = null;
		}
	}

	private void button1_Click(object sender, EventArgs e)
	{
		if (treeViewHistory.SelectedNode != null)
		{
			string name = treeViewHistory.SelectedNode.Text;
			experiment.DeleteConfig(name);
			ShowHistoryFiles();
		}
	}

	private void btnSet_Click(object sender, EventArgs e)
	{
		try
		{
			double max = double.Parse(textBox1.Text);
			zedGraph.GraphPane.Y2Axis.Scale.Max = max;
			zedGraph.AxisChange();
			zedGraph.Refresh();
		}
		catch (Exception)
		{
			MessageBox.Show(Lang.Txt("AddFormIgnite.Warn"), Lang.Txt("FormHalfAutoTune.TipsText3"));
		}
	}

	private void btnLog_Click(object sender, EventArgs e)
	{
		string tmpName = Path.GetTempFileName();
		using (StreamWriter sw = new StreamWriter(tmpName))
		{
			StringBuilder sb = new StringBuilder();
			foreach (object item in listBox1.Items)
			{
				sb.AppendLine(item.ToString());
			}
			sw.WriteLine(sb.ToString());
		}
		Process.Start("notepad.exe", tmpName);
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("历史数据");
		this.wizard1 = new CristiPotlog.Controls.Wizard();
		this.wizardTune = new CristiPotlog.Controls.WizardPage();
		this.gbShow = new System.Windows.Forms.GroupBox();
		this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
		this.listBox1 = new System.Windows.Forms.ListBox();
		this.zedGraph = new ZedGraph.ZedGraphControl();
		this.wizardUpdate = new CristiPotlog.Controls.WizardPage();
		this.btnContinue = new System.Windows.Forms.Button();
		this.btnPause = new System.Windows.Forms.Button();
		this.lblUptake = new System.Windows.Forms.Label();
		this.barUptake = new System.Windows.Forms.ProgressBar();
		this.label3 = new System.Windows.Forms.Label();
		this.wizardSample = new CristiPotlog.Controls.WizardPage();
		this.label2 = new System.Windows.Forms.Label();
		this.label1 = new System.Windows.Forms.Label();
		this.wizardDescription = new CristiPotlog.Controls.WizardPage();
		this.txtCfgSolution = new System.Windows.Forms.TextBox();
		this.label15 = new System.Windows.Forms.Label();
		this.txtCfgDescription = new System.Windows.Forms.TextBox();
		this.label14 = new System.Windows.Forms.Label();
		this.txtCfgName = new System.Windows.Forms.TextBox();
		this.label13 = new System.Windows.Forms.Label();
		this.wizardDevices = new CristiPotlog.Controls.WizardPage();
		this.btnLoadCurrentParam = new System.Windows.Forms.Button();
		this.dgvDevices = new System.Windows.Forms.DataGridView();
		this.colUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
		this.colUseDefault = new System.Windows.Forms.DataGridViewCheckBoxColumn();
		this.colConditions = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colMinValue = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colDefaultValue = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colMaxValue = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colError1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colError2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.wizardTuneIsotopes = new CristiPotlog.Controls.WizardPage();
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.btnDeleteRatios = new System.Windows.Forms.Button();
		this.btnAddRatios = new System.Windows.Forms.Button();
		this.dgvRatios = new System.Windows.Forms.DataGridView();
		this.dgvNumerator = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dgvDenominator = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.btnDeleteIsotope = new System.Windows.Forms.Button();
		this.btnAddIsotope = new System.Windows.Forms.Button();
		this.dgvIsotopes = new System.Windows.Forms.DataGridView();
		this.colSymbol = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colMass = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colDwell = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.wizardHistory = new CristiPotlog.Controls.WizardPage();
		this.button1 = new System.Windows.Forms.Button();
		this.gbHistoryDescript = new System.Windows.Forms.GroupBox();
		this.lblHistoryDescript = new System.Windows.Forms.Label();
		this.gbHistoryDatas = new System.Windows.Forms.GroupBox();
		this.treeViewHistory = new System.Windows.Forms.TreeView();
		this.wizardEdit = new CristiPotlog.Controls.WizardPage();
		this.lblOption2 = new System.Windows.Forms.Label();
		this.lblOption1 = new System.Windows.Forms.Label();
		this.rdbtnCreate = new System.Windows.Forms.RadioButton();
		this.rdbtnEdit = new System.Windows.Forms.RadioButton();
		this.wizardFinish = new CristiPotlog.Controls.WizardPage();
		this.wizardWelcome = new CristiPotlog.Controls.WizardPage();
		this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.label4 = new System.Windows.Forms.Label();
		this.textBox1 = new System.Windows.Forms.TextBox();
		this.btnSet = new System.Windows.Forms.Button();
		this.btnLog = new System.Windows.Forms.Button();
		this.wizard1.SuspendLayout();
		this.wizardTune.SuspendLayout();
		this.gbShow.SuspendLayout();
		this.wizardUpdate.SuspendLayout();
		this.wizardSample.SuspendLayout();
		this.wizardDescription.SuspendLayout();
		this.wizardDevices.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvDevices).BeginInit();
		this.wizardTuneIsotopes.SuspendLayout();
		this.groupBox2.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvRatios).BeginInit();
		this.groupBox1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvIsotopes).BeginInit();
		this.wizardHistory.SuspendLayout();
		this.gbHistoryDescript.SuspendLayout();
		this.gbHistoryDatas.SuspendLayout();
		this.wizardEdit.SuspendLayout();
		this.wizardFinish.SuspendLayout();
		base.SuspendLayout();
		this.wizard1.Controls.Add(this.wizardFinish);
		this.wizard1.Controls.Add(this.wizardTune);
		this.wizard1.Controls.Add(this.wizardUpdate);
		this.wizard1.Controls.Add(this.wizardSample);
		this.wizard1.Controls.Add(this.wizardDescription);
		this.wizard1.Controls.Add(this.wizardDevices);
		this.wizard1.Controls.Add(this.wizardTuneIsotopes);
		this.wizard1.Controls.Add(this.wizardHistory);
		this.wizard1.Controls.Add(this.wizardEdit);
		this.wizard1.Controls.Add(this.wizardWelcome);
		this.wizard1.HeaderImage = ICP_MS.Plugin.Tune.Properties.Resources.wizardHeader;
		this.wizard1.Location = new System.Drawing.Point(0, 0);
		this.wizard1.Name = "wizard1";
		this.wizard1.Pages.AddRange(new CristiPotlog.Controls.WizardPage[10] { this.wizardWelcome, this.wizardEdit, this.wizardHistory, this.wizardTuneIsotopes, this.wizardDevices, this.wizardDescription, this.wizardSample, this.wizardUpdate, this.wizardTune, this.wizardFinish });
		this.wizard1.Size = new System.Drawing.Size(997, 645);
		this.wizard1.TabIndex = 0;
		this.wizard1.WelcomeImage = ICP_MS.Plugin.Tune.Properties.Resources.wizardWelcom;
		this.wizard1.BeforeSwitchPages += new CristiPotlog.Controls.Wizard.BeforeSwitchPagesEventHandler(wizard1_BeforeSwitchPages);
		this.wizard1.AfterSwitchPages += new CristiPotlog.Controls.Wizard.AfterSwitchPagesEventHandler(wizard1_AfterSwitchPages);
		this.wizard1.Cancel += new System.ComponentModel.CancelEventHandler(wizard1_Cancel);
		this.wizard1.Load += new System.EventHandler(wizard1_Load);
		this.wizardTune.Controls.Add(this.btnSet);
		this.wizardTune.Controls.Add(this.textBox1);
		this.wizardTune.Controls.Add(this.label4);
		this.wizardTune.Controls.Add(this.gbShow);
		this.wizardTune.Controls.Add(this.listBox1);
		this.wizardTune.Controls.Add(this.zedGraph);
		this.wizardTune.Description = "开始采集，并调谐";
		this.wizardTune.Location = new System.Drawing.Point(0, 0);
		this.wizardTune.Name = "wizardTune";
		this.wizardTune.Size = new System.Drawing.Size(997, 597);
		this.wizardTune.TabIndex = 15;
		this.wizardTune.Title = "开始调谐";
		this.gbShow.Controls.Add(this.flowLayoutPanel1);
		this.gbShow.Location = new System.Drawing.Point(12, 523);
		this.gbShow.Name = "gbShow";
		this.gbShow.Size = new System.Drawing.Size(965, 71);
		this.gbShow.TabIndex = 4;
		this.gbShow.TabStop = false;
		this.gbShow.Text = "显示/隐藏";
		this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 21);
		this.flowLayoutPanel1.Name = "flowLayoutPanel1";
		this.flowLayoutPanel1.Size = new System.Drawing.Size(959, 47);
		this.flowLayoutPanel1.TabIndex = 5;
		this.listBox1.FormattingEnabled = true;
		this.listBox1.ItemHeight = 15;
		this.listBox1.Location = new System.Drawing.Point(16, 69);
		this.listBox1.Name = "listBox1";
		this.listBox1.Size = new System.Drawing.Size(172, 409);
		this.listBox1.TabIndex = 3;
		this.zedGraph.Location = new System.Drawing.Point(195, 69);
		this.zedGraph.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
		this.zedGraph.Name = "zedGraph";
		this.zedGraph.ScrollGrace = 0.0;
		this.zedGraph.ScrollMaxX = 0.0;
		this.zedGraph.ScrollMaxY = 0.0;
		this.zedGraph.ScrollMaxY2 = 0.0;
		this.zedGraph.ScrollMinX = 0.0;
		this.zedGraph.ScrollMinY = 0.0;
		this.zedGraph.ScrollMinY2 = 0.0;
		this.zedGraph.Size = new System.Drawing.Size(776, 409);
		this.zedGraph.TabIndex = 2;
		this.wizardUpdate.Controls.Add(this.btnContinue);
		this.wizardUpdate.Controls.Add(this.btnPause);
		this.wizardUpdate.Controls.Add(this.lblUptake);
		this.wizardUpdate.Controls.Add(this.barUptake);
		this.wizardUpdate.Controls.Add(this.label3);
		this.wizardUpdate.Location = new System.Drawing.Point(0, 0);
		this.wizardUpdate.Name = "wizardUpdate";
		this.wizardUpdate.Size = new System.Drawing.Size(993, 579);
		this.wizardUpdate.TabIndex = 14;
		this.wizardUpdate.Title = "提升样品";
		this.btnContinue.Location = new System.Drawing.Point(530, 321);
		this.btnContinue.Margin = new System.Windows.Forms.Padding(4);
		this.btnContinue.Name = "btnContinue";
		this.btnContinue.Size = new System.Drawing.Size(100, 29);
		this.btnContinue.TabIndex = 9;
		this.btnContinue.Text = "继续";
		this.btnContinue.UseVisualStyleBackColor = true;
		this.btnContinue.Click += new System.EventHandler(btnContinue_Click);
		this.btnPause.Location = new System.Drawing.Point(380, 321);
		this.btnPause.Margin = new System.Windows.Forms.Padding(4);
		this.btnPause.Name = "btnPause";
		this.btnPause.Size = new System.Drawing.Size(100, 29);
		this.btnPause.TabIndex = 8;
		this.btnPause.Text = "暂停";
		this.btnPause.UseVisualStyleBackColor = true;
		this.btnPause.Click += new System.EventHandler(btnPause_Click);
		this.lblUptake.AutoSize = true;
		this.lblUptake.Location = new System.Drawing.Point(486, 283);
		this.lblUptake.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblUptake.Name = "lblUptake";
		this.lblUptake.Size = new System.Drawing.Size(39, 15);
		this.lblUptake.TabIndex = 7;
		this.lblUptake.Text = "40 s";
		this.barUptake.Location = new System.Drawing.Point(275, 236);
		this.barUptake.Margin = new System.Windows.Forms.Padding(4);
		this.barUptake.Maximum = 40;
		this.barUptake.Name = "barUptake";
		this.barUptake.Size = new System.Drawing.Size(496, 29);
		this.barUptake.Step = 1;
		this.barUptake.TabIndex = 6;
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(235, 191);
		this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(353, 15);
		this.label3.TabIndex = 5;
		this.label3.Text = "提升溶液，点击 下一步 跳过此步骤，直接开始调谐";
		this.wizardSample.Controls.Add(this.label2);
		this.wizardSample.Controls.Add(this.label1);
		this.wizardSample.Description = "准备样品，进样...";
		this.wizardSample.Location = new System.Drawing.Point(0, 0);
		this.wizardSample.Name = "wizardSample";
		this.wizardSample.Size = new System.Drawing.Size(993, 579);
		this.wizardSample.TabIndex = 13;
		this.wizardSample.Title = "进样";
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(67, 171);
		this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(82, 15);
		this.label2.TabIndex = 3;
		this.label2.Text = "溶液要求：";
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(67, 119);
		this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(308, 15);
		this.label1.TabIndex = 2;
		this.label1.Text = "将进样管放入溶液后，点击 下一步 提升溶液";
		this.wizardDescription.Controls.Add(this.txtCfgSolution);
		this.wizardDescription.Controls.Add(this.label15);
		this.wizardDescription.Controls.Add(this.txtCfgDescription);
		this.wizardDescription.Controls.Add(this.label14);
		this.wizardDescription.Controls.Add(this.txtCfgName);
		this.wizardDescription.Controls.Add(this.label13);
		this.wizardDescription.Description = "保存名称及说明";
		this.wizardDescription.Location = new System.Drawing.Point(0, 0);
		this.wizardDescription.Name = "wizardDescription";
		this.wizardDescription.Size = new System.Drawing.Size(993, 579);
		this.wizardDescription.TabIndex = 19;
		this.wizardDescription.Title = "名称和说明";
		this.txtCfgSolution.Location = new System.Drawing.Point(153, 286);
		this.txtCfgSolution.Margin = new System.Windows.Forms.Padding(4);
		this.txtCfgSolution.Multiline = true;
		this.txtCfgSolution.Name = "txtCfgSolution";
		this.txtCfgSolution.Size = new System.Drawing.Size(535, 92);
		this.txtCfgSolution.TabIndex = 11;
		this.label15.AutoSize = true;
		this.label15.Location = new System.Drawing.Point(62, 291);
		this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label15.Name = "label15";
		this.label15.Size = new System.Drawing.Size(82, 15);
		this.label15.TabIndex = 10;
		this.label15.Text = "调谐溶液：";
		this.txtCfgDescription.Location = new System.Drawing.Point(153, 146);
		this.txtCfgDescription.Margin = new System.Windows.Forms.Padding(4);
		this.txtCfgDescription.Multiline = true;
		this.txtCfgDescription.Name = "txtCfgDescription";
		this.txtCfgDescription.Size = new System.Drawing.Size(535, 123);
		this.txtCfgDescription.TabIndex = 9;
		this.label14.AutoSize = true;
		this.label14.Location = new System.Drawing.Point(62, 154);
		this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label14.Name = "label14";
		this.label14.Size = new System.Drawing.Size(82, 15);
		this.label14.TabIndex = 8;
		this.label14.Text = "配置说明：";
		this.txtCfgName.Location = new System.Drawing.Point(153, 106);
		this.txtCfgName.Margin = new System.Windows.Forms.Padding(4);
		this.txtCfgName.Name = "txtCfgName";
		this.txtCfgName.Size = new System.Drawing.Size(535, 25);
		this.txtCfgName.TabIndex = 7;
		this.label13.AutoSize = true;
		this.label13.Location = new System.Drawing.Point(62, 112);
		this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.label13.Name = "label13";
		this.label13.Size = new System.Drawing.Size(82, 15);
		this.label13.TabIndex = 6;
		this.label13.Text = "配置名称：";
		this.wizardDevices.Controls.Add(this.btnLoadCurrentParam);
		this.wizardDevices.Controls.Add(this.dgvDevices);
		this.wizardDevices.Description = "选择调谐参数（只能选择一个）";
		this.wizardDevices.Location = new System.Drawing.Point(0, 0);
		this.wizardDevices.Name = "wizardDevices";
		this.wizardDevices.Size = new System.Drawing.Size(993, 579);
		this.wizardDevices.TabIndex = 12;
		this.wizardDevices.Title = "选择调谐参数";
		this.btnLoadCurrentParam.Location = new System.Drawing.Point(813, 522);
		this.btnLoadCurrentParam.Name = "btnLoadCurrentParam";
		this.btnLoadCurrentParam.Size = new System.Drawing.Size(106, 43);
		this.btnLoadCurrentParam.TabIndex = 2;
		this.btnLoadCurrentParam.Text = "加载当前参数";
		this.btnLoadCurrentParam.UseVisualStyleBackColor = true;
		this.btnLoadCurrentParam.Click += new System.EventHandler(btnLoadCurrentParam_Click);
		this.dgvDevices.AllowUserToAddRows = false;
		this.dgvDevices.AllowUserToDeleteRows = false;
		this.dgvDevices.AllowUserToResizeRows = false;
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvDevices.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
		this.dgvDevices.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvDevices.Columns.AddRange(this.colUse, this.colUseDefault, this.colConditions, this.colMinValue, this.colDefaultValue, this.colMaxValue, this.colError1, this.colError2);
		this.dgvDevices.Location = new System.Drawing.Point(49, 82);
		this.dgvDevices.Margin = new System.Windows.Forms.Padding(4);
		this.dgvDevices.Name = "dgvDevices";
		this.dgvDevices.RowHeadersVisible = false;
		this.dgvDevices.RowTemplate.Height = 23;
		this.dgvDevices.Size = new System.Drawing.Size(904, 413);
		this.dgvDevices.TabIndex = 1;
		this.dgvDevices.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(dgvDevices_CellValueChanged);
		this.colUse.DataPropertyName = "Selected";
		this.colUse.HeaderText = "选择";
		this.colUse.Name = "colUse";
		this.colUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.colUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
		this.colUse.Width = 50;
		this.colUseDefault.DataPropertyName = "Force";
		this.colUseDefault.HeaderText = "默认值";
		this.colUseDefault.Name = "colUseDefault";
		this.colUseDefault.Visible = false;
		this.colUseDefault.Width = 40;
		this.colConditions.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colConditions.DataPropertyName = "Device";
		this.colConditions.FillWeight = 50f;
		this.colConditions.HeaderText = "硬件";
		this.colConditions.Name = "colConditions";
		this.colConditions.ReadOnly = true;
		this.colMinValue.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colMinValue.DataPropertyName = "MinValue";
		this.colMinValue.FillWeight = 35.16484f;
		this.colMinValue.HeaderText = "最小值";
		this.colMinValue.Name = "colMinValue";
		this.colDefaultValue.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colDefaultValue.DataPropertyName = "DefaultValue";
		this.colDefaultValue.FillWeight = 35.16484f;
		this.colDefaultValue.HeaderText = "默认值";
		this.colDefaultValue.Name = "colDefaultValue";
		this.colMaxValue.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colMaxValue.DataPropertyName = "MaxValue";
		this.colMaxValue.FillWeight = 35.16484f;
		this.colMaxValue.HeaderText = "最大值";
		this.colMaxValue.Name = "colMaxValue";
		this.colError1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colError1.DataPropertyName = "ReadErr";
		this.colError1.FillWeight = 35.16484f;
		this.colError1.HeaderText = "设定 误差";
		this.colError1.Name = "colError1";
		this.colError2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.colError2.DataPropertyName = "FinishErr";
		this.colError2.FillWeight = 35.16484f;
		this.colError2.HeaderText = "步进值";
		this.colError2.Name = "colError2";
		this.wizardTuneIsotopes.Controls.Add(this.groupBox2);
		this.wizardTuneIsotopes.Controls.Add(this.groupBox1);
		this.wizardTuneIsotopes.Description = "选择调谐需要用到的元素";
		this.wizardTuneIsotopes.Location = new System.Drawing.Point(0, 0);
		this.wizardTuneIsotopes.Name = "wizardTuneIsotopes";
		this.wizardTuneIsotopes.Size = new System.Drawing.Size(993, 579);
		this.wizardTuneIsotopes.TabIndex = 11;
		this.wizardTuneIsotopes.Title = "选择调谐元素";
		this.groupBox2.Controls.Add(this.btnDeleteRatios);
		this.groupBox2.Controls.Add(this.btnAddRatios);
		this.groupBox2.Controls.Add(this.dgvRatios);
		this.groupBox2.Location = new System.Drawing.Point(83, 369);
		this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Padding = new System.Windows.Forms.Padding(4);
		this.groupBox2.Size = new System.Drawing.Size(758, 156);
		this.groupBox2.TabIndex = 3;
		this.groupBox2.TabStop = false;
		this.groupBox2.Text = "比率";
		this.btnDeleteRatios.Location = new System.Drawing.Point(511, 88);
		this.btnDeleteRatios.Margin = new System.Windows.Forms.Padding(4);
		this.btnDeleteRatios.Name = "btnDeleteRatios";
		this.btnDeleteRatios.Size = new System.Drawing.Size(100, 29);
		this.btnDeleteRatios.TabIndex = 4;
		this.btnDeleteRatios.Text = "删除";
		this.btnDeleteRatios.UseVisualStyleBackColor = true;
		this.btnDeleteRatios.Click += new System.EventHandler(btnDeleteRatios_Click);
		this.btnAddRatios.Location = new System.Drawing.Point(511, 39);
		this.btnAddRatios.Margin = new System.Windows.Forms.Padding(4);
		this.btnAddRatios.Name = "btnAddRatios";
		this.btnAddRatios.Size = new System.Drawing.Size(100, 29);
		this.btnAddRatios.TabIndex = 3;
		this.btnAddRatios.Text = "添加";
		this.btnAddRatios.UseVisualStyleBackColor = true;
		this.btnAddRatios.Click += new System.EventHandler(btnAddRatios_Click);
		this.dgvRatios.AllowUserToAddRows = false;
		this.dgvRatios.AllowUserToDeleteRows = false;
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvRatios.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
		this.dgvRatios.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvRatios.Columns.AddRange(this.dgvNumerator, this.dgvDenominator, this.dataGridViewTextBoxColumn3);
		this.dgvRatios.Location = new System.Drawing.Point(8, 25);
		this.dgvRatios.Margin = new System.Windows.Forms.Padding(4);
		this.dgvRatios.Name = "dgvRatios";
		this.dgvRatios.RowTemplate.Height = 23;
		this.dgvRatios.Size = new System.Drawing.Size(461, 106);
		this.dgvRatios.TabIndex = 3;
		this.dgvRatios.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvRatios_CellFormatting);
		this.dgvNumerator.DataPropertyName = "Numerator";
		this.dgvNumerator.HeaderText = "分子";
		this.dgvNumerator.Name = "dgvNumerator";
		this.dgvNumerator.ReadOnly = true;
		this.dgvDenominator.DataPropertyName = "Denominator";
		this.dgvDenominator.HeaderText = "分母";
		this.dgvDenominator.Name = "dgvDenominator";
		this.dgvDenominator.ReadOnly = true;
		this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn3.DataPropertyName = "Dwell";
		this.dataGridViewTextBoxColumn3.HeaderText = "驻留时间";
		this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
		this.dataGridViewTextBoxColumn3.ReadOnly = true;
		this.groupBox1.Controls.Add(this.btnDeleteIsotope);
		this.groupBox1.Controls.Add(this.btnAddIsotope);
		this.groupBox1.Controls.Add(this.dgvIsotopes);
		this.groupBox1.Location = new System.Drawing.Point(83, 99);
		this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
		this.groupBox1.Size = new System.Drawing.Size(758, 262);
		this.groupBox1.TabIndex = 2;
		this.groupBox1.TabStop = false;
		this.groupBox1.Text = "调谐元素";
		this.btnDeleteIsotope.Location = new System.Drawing.Point(511, 149);
		this.btnDeleteIsotope.Margin = new System.Windows.Forms.Padding(4);
		this.btnDeleteIsotope.Name = "btnDeleteIsotope";
		this.btnDeleteIsotope.Size = new System.Drawing.Size(100, 29);
		this.btnDeleteIsotope.TabIndex = 2;
		this.btnDeleteIsotope.Text = "删除";
		this.btnDeleteIsotope.UseVisualStyleBackColor = true;
		this.btnDeleteIsotope.Click += new System.EventHandler(btnDeleteIsotope_Click);
		this.btnAddIsotope.Location = new System.Drawing.Point(511, 101);
		this.btnAddIsotope.Margin = new System.Windows.Forms.Padding(4);
		this.btnAddIsotope.Name = "btnAddIsotope";
		this.btnAddIsotope.Size = new System.Drawing.Size(100, 29);
		this.btnAddIsotope.TabIndex = 1;
		this.btnAddIsotope.Text = "添加";
		this.btnAddIsotope.UseVisualStyleBackColor = true;
		this.btnAddIsotope.Click += new System.EventHandler(btnAddIsotope_Click);
		this.dgvIsotopes.AllowUserToAddRows = false;
		this.dgvIsotopes.AllowUserToDeleteRows = false;
		dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvIsotopes.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
		this.dgvIsotopes.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvIsotopes.Columns.AddRange(this.colSymbol, this.colMass, this.colDwell);
		this.dgvIsotopes.Location = new System.Drawing.Point(8, 25);
		this.dgvIsotopes.Margin = new System.Windows.Forms.Padding(4);
		this.dgvIsotopes.Name = "dgvIsotopes";
		this.dgvIsotopes.RowTemplate.Height = 23;
		this.dgvIsotopes.Size = new System.Drawing.Size(461, 213);
		this.dgvIsotopes.TabIndex = 0;
		this.colSymbol.DataPropertyName = "Symbol";
		this.colSymbol.HeaderText = "元素";
		this.colSymbol.Name = "colSymbol";
		this.colSymbol.ReadOnly = true;
		this.colMass.DataPropertyName = "Mass";
		this.colMass.HeaderText = "质量数";
		this.colMass.Name = "colMass";
		this.colMass.ReadOnly = true;
		this.colDwell.DataPropertyName = "Dwell";
		this.colDwell.HeaderText = "驻留时间";
		this.colDwell.Name = "colDwell";
		this.colDwell.ReadOnly = true;
		this.wizardHistory.Controls.Add(this.button1);
		this.wizardHistory.Controls.Add(this.gbHistoryDescript);
		this.wizardHistory.Controls.Add(this.gbHistoryDatas);
		this.wizardHistory.Description = "选择一个历史配置";
		this.wizardHistory.Location = new System.Drawing.Point(0, 0);
		this.wizardHistory.Name = "wizardHistory";
		this.wizardHistory.Size = new System.Drawing.Size(993, 579);
		this.wizardHistory.TabIndex = 17;
		this.wizardHistory.Title = "历史配置";
		this.button1.Location = new System.Drawing.Point(29, 391);
		this.button1.Name = "button1";
		this.button1.Size = new System.Drawing.Size(75, 23);
		this.button1.TabIndex = 6;
		this.button1.Text = "删除";
		this.button1.UseVisualStyleBackColor = true;
		this.button1.Click += new System.EventHandler(button1_Click);
		this.gbHistoryDescript.Controls.Add(this.lblHistoryDescript);
		this.gbHistoryDescript.Location = new System.Drawing.Point(360, 81);
		this.gbHistoryDescript.Margin = new System.Windows.Forms.Padding(4);
		this.gbHistoryDescript.Name = "gbHistoryDescript";
		this.gbHistoryDescript.Padding = new System.Windows.Forms.Padding(4);
		this.gbHistoryDescript.Size = new System.Drawing.Size(341, 292);
		this.gbHistoryDescript.TabIndex = 5;
		this.gbHistoryDescript.TabStop = false;
		this.gbHistoryDescript.Text = "配置说明";
		this.lblHistoryDescript.Dock = System.Windows.Forms.DockStyle.Fill;
		this.lblHistoryDescript.Location = new System.Drawing.Point(4, 22);
		this.lblHistoryDescript.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblHistoryDescript.Name = "lblHistoryDescript";
		this.lblHistoryDescript.Size = new System.Drawing.Size(333, 266);
		this.lblHistoryDescript.TabIndex = 0;
		this.lblHistoryDescript.Text = "label1";
		this.gbHistoryDatas.Controls.Add(this.treeViewHistory);
		this.gbHistoryDatas.Location = new System.Drawing.Point(25, 80);
		this.gbHistoryDatas.Margin = new System.Windows.Forms.Padding(4);
		this.gbHistoryDatas.Name = "gbHistoryDatas";
		this.gbHistoryDatas.Padding = new System.Windows.Forms.Padding(4);
		this.gbHistoryDatas.Size = new System.Drawing.Size(327, 292);
		this.gbHistoryDatas.TabIndex = 4;
		this.gbHistoryDatas.TabStop = false;
		this.gbHistoryDatas.Text = "历史配置";
		this.treeViewHistory.Dock = System.Windows.Forms.DockStyle.Fill;
		this.treeViewHistory.Location = new System.Drawing.Point(4, 22);
		this.treeViewHistory.Margin = new System.Windows.Forms.Padding(4);
		this.treeViewHistory.Name = "treeViewHistory";
		treeNode2.Name = "nodeHitoryRoot";
		treeNode2.Text = "历史数据";
		this.treeViewHistory.Nodes.AddRange(new System.Windows.Forms.TreeNode[1] { treeNode2 });
		this.treeViewHistory.Size = new System.Drawing.Size(319, 266);
		this.treeViewHistory.TabIndex = 0;
		this.treeViewHistory.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeViewHistory_AfterSelect);
		this.wizardEdit.Controls.Add(this.lblOption2);
		this.wizardEdit.Controls.Add(this.lblOption1);
		this.wizardEdit.Controls.Add(this.rdbtnCreate);
		this.wizardEdit.Controls.Add(this.rdbtnEdit);
		this.wizardEdit.Description = "创建或者编辑一个已经存在的配置";
		this.wizardEdit.Location = new System.Drawing.Point(0, 0);
		this.wizardEdit.Name = "wizardEdit";
		this.wizardEdit.Size = new System.Drawing.Size(993, 579);
		this.wizardEdit.TabIndex = 18;
		this.wizardEdit.Title = "编辑配置";
		this.lblOption2.AutoSize = true;
		this.lblOption2.BackColor = System.Drawing.Color.Transparent;
		this.lblOption2.Location = new System.Drawing.Point(193, 277);
		this.lblOption2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblOption2.Name = "lblOption2";
		this.lblOption2.Size = new System.Drawing.Size(202, 15);
		this.lblOption2.TabIndex = 7;
		this.lblOption2.Text = "使用该选项创建一个新的配置";
		this.lblOption1.AutoSize = true;
		this.lblOption1.BackColor = System.Drawing.Color.Transparent;
		this.lblOption1.Location = new System.Drawing.Point(193, 208);
		this.lblOption1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblOption1.Name = "lblOption1";
		this.lblOption1.Size = new System.Drawing.Size(307, 15);
		this.lblOption1.TabIndex = 6;
		this.lblOption1.Text = "使用该选项重新编辑以修改一个已存在的配置";
		this.rdbtnCreate.AutoSize = true;
		this.rdbtnCreate.BackColor = System.Drawing.Color.Transparent;
		this.rdbtnCreate.Location = new System.Drawing.Point(167, 239);
		this.rdbtnCreate.Margin = new System.Windows.Forms.Padding(4);
		this.rdbtnCreate.Name = "rdbtnCreate";
		this.rdbtnCreate.Size = new System.Drawing.Size(118, 19);
		this.rdbtnCreate.TabIndex = 5;
		this.rdbtnCreate.TabStop = true;
		this.rdbtnCreate.Text = "创建调谐配置";
		this.rdbtnCreate.UseVisualStyleBackColor = false;
		this.rdbtnEdit.AutoSize = true;
		this.rdbtnEdit.BackColor = System.Drawing.Color.Transparent;
		this.rdbtnEdit.Location = new System.Drawing.Point(167, 167);
		this.rdbtnEdit.Margin = new System.Windows.Forms.Padding(4);
		this.rdbtnEdit.Name = "rdbtnEdit";
		this.rdbtnEdit.Size = new System.Drawing.Size(118, 19);
		this.rdbtnEdit.TabIndex = 4;
		this.rdbtnEdit.TabStop = true;
		this.rdbtnEdit.Text = "编辑调谐配置";
		this.rdbtnEdit.UseVisualStyleBackColor = false;
		this.wizardFinish.Controls.Add(this.btnLog);
		this.wizardFinish.Description = "完成参数优化";
		this.wizardFinish.Location = new System.Drawing.Point(0, 0);
		this.wizardFinish.Name = "wizardFinish";
		this.wizardFinish.Size = new System.Drawing.Size(997, 597);
		this.wizardFinish.Style = CristiPotlog.Controls.WizardPageStyle.Finish;
		this.wizardFinish.TabIndex = 16;
		this.wizardFinish.Title = "完成";
		this.wizardWelcome.Description = "调谐参数设置和优化";
		this.wizardWelcome.Location = new System.Drawing.Point(0, 0);
		this.wizardWelcome.Name = "wizardWelcome";
		this.wizardWelcome.Size = new System.Drawing.Size(993, 579);
		this.wizardWelcome.Style = CristiPotlog.Controls.WizardPageStyle.Welcome;
		this.wizardWelcome.TabIndex = 10;
		this.wizardWelcome.Title = "参数优化";
		this.dataGridViewTextBoxColumn1.DataPropertyName = "Numerator";
		this.dataGridViewTextBoxColumn1.HeaderText = "分子";
		this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
		this.dataGridViewTextBoxColumn1.ReadOnly = true;
		this.dataGridViewTextBoxColumn2.DataPropertyName = "Denominator";
		this.dataGridViewTextBoxColumn2.HeaderText = "分母";
		this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
		this.dataGridViewTextBoxColumn2.ReadOnly = true;
		this.dataGridViewTextBoxColumn4.DataPropertyName = "Symbol";
		this.dataGridViewTextBoxColumn4.HeaderText = "元素";
		this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
		this.dataGridViewTextBoxColumn4.ReadOnly = true;
		this.dataGridViewTextBoxColumn5.DataPropertyName = "Mass";
		this.dataGridViewTextBoxColumn5.HeaderText = "质量数";
		this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
		this.dataGridViewTextBoxColumn5.ReadOnly = true;
		this.dataGridViewTextBoxColumn6.DataPropertyName = "Dwell";
		this.dataGridViewTextBoxColumn6.HeaderText = "驻留时间";
		this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
		this.dataGridViewTextBoxColumn6.ReadOnly = true;
		this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn7.DataPropertyName = "Device";
		this.dataGridViewTextBoxColumn7.FillWeight = 50f;
		this.dataGridViewTextBoxColumn7.HeaderText = "硬件";
		this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
		this.dataGridViewTextBoxColumn7.ReadOnly = true;
		this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn8.DataPropertyName = "MinValue";
		this.dataGridViewTextBoxColumn8.FillWeight = 35.16484f;
		this.dataGridViewTextBoxColumn8.HeaderText = "最小值";
		this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
		this.dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn9.DataPropertyName = "DefaultValue";
		this.dataGridViewTextBoxColumn9.FillWeight = 35.16484f;
		this.dataGridViewTextBoxColumn9.HeaderText = "默认值";
		this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
		this.dataGridViewTextBoxColumn10.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn10.DataPropertyName = "MaxValue";
		this.dataGridViewTextBoxColumn10.FillWeight = 35.16484f;
		this.dataGridViewTextBoxColumn10.HeaderText = "最大值";
		this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
		this.dataGridViewTextBoxColumn11.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn11.DataPropertyName = "ReadErr";
		this.dataGridViewTextBoxColumn11.FillWeight = 35.16484f;
		this.dataGridViewTextBoxColumn11.HeaderText = "设定 误差";
		this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
		this.dataGridViewTextBoxColumn12.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn12.DataPropertyName = "FinishErr";
		this.dataGridViewTextBoxColumn12.FillWeight = 35.16484f;
		this.dataGridViewTextBoxColumn12.HeaderText = "步进值";
		this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(14, 494);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(128, 15);
		this.label4.TabIndex = 5;
		this.label4.Text = "Y2坐标轴最大值：";
		this.textBox1.Location = new System.Drawing.Point(137, 488);
		this.textBox1.Name = "textBox1";
		this.textBox1.Size = new System.Drawing.Size(97, 25);
		this.textBox1.TabIndex = 6;
		this.btnSet.Location = new System.Drawing.Point(253, 488);
		this.btnSet.Name = "btnSet";
		this.btnSet.Size = new System.Drawing.Size(107, 29);
		this.btnSet.TabIndex = 7;
		this.btnSet.Text = "设置";
		this.btnSet.UseVisualStyleBackColor = true;
		this.btnSet.Click += new System.EventHandler(btnSet_Click);
		this.btnLog.Location = new System.Drawing.Point(281, 455);
		this.btnLog.Margin = new System.Windows.Forms.Padding(4);
		this.btnLog.Name = "btnLog";
		this.btnLog.Size = new System.Drawing.Size(100, 29);
		this.btnLog.TabIndex = 2;
		this.btnLog.Text = "日志";
		this.btnLog.UseVisualStyleBackColor = true;
		this.btnLog.Click += new System.EventHandler(btnLog_Click);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
		base.ClientSize = new System.Drawing.Size(997, 645);
		base.Controls.Add(this.wizard1);
		base.Name = "FormHalfAutoTune";
		this.Text = "参数优化";
		base.Load += new System.EventHandler(FormHalfAutoTune_Load);
		this.wizard1.ResumeLayout(false);
		this.wizardTune.ResumeLayout(false);
		this.wizardTune.PerformLayout();
		this.gbShow.ResumeLayout(false);
		this.wizardUpdate.ResumeLayout(false);
		this.wizardUpdate.PerformLayout();
		this.wizardSample.ResumeLayout(false);
		this.wizardSample.PerformLayout();
		this.wizardDescription.ResumeLayout(false);
		this.wizardDescription.PerformLayout();
		this.wizardDevices.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvDevices).EndInit();
		this.wizardTuneIsotopes.ResumeLayout(false);
		this.groupBox2.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvRatios).EndInit();
		this.groupBox1.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.dgvIsotopes).EndInit();
		this.wizardHistory.ResumeLayout(false);
		this.gbHistoryDescript.ResumeLayout(false);
		this.gbHistoryDatas.ResumeLayout(false);
		this.wizardEdit.ResumeLayout(false);
		this.wizardEdit.PerformLayout();
		this.wizardFinish.ResumeLayout(false);
		base.ResumeLayout(false);
	}
}
